package com.xgpro.mapper.studycentre;

import com.xgpro.domain.studycentre.entity.DaiTuTea;
import com.xgpro.domain.studycentre.vo.EVAEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


/**
 * @author tx
 * @version 1.0
 * @date 2019/9/10 22:44
 */
public interface DaiTuTeaMapper extends Mapper<DaiTuTea> {

    @Select("<script>" +
            "select t_teacher_student.id as id,t_teacher_student.tea_id as teaId,t_teacher_student.stu_id as stuId,t_teacher_student.tea_eva_url as teaEvaUrl,t_teacher_student.stu_eva_url as stuEvaUrl " +
            "from  t_teacher_student  where t_teacher_student.tea_id in ( select id from t_user " +
            "<where>" +
            "  t_teacher_student.status=1 " +
            " <if test=\"teaName != null and teaName!='' \"> " +
            "  and t_user.username like CONCAT('%',#{teaName},'%')" +
            " </if>" +
            "</where> )" +
            "</script>")
    List<EVAEntity> selectEVAReult(@Param("teaName") String teaName);
}
